home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_jewelactivated.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  144 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # nub_JewelActivate.cog
  5. #
  6. # [GGJ]
  7. #
  8. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  9. #
  10. # ========================================================================================
  11. symbols
  12.  
  13. message        startup
  14. message        damaged
  15. message        exited
  16. message        entered
  17. message        arrived
  18.  
  19. thing        charger        mask=0x8
  20. thing        blastdoor
  21. thing        jewel
  22. thing        jewelTarg
  23. thing        plasma
  24. thing        player        local
  25. thing        cam1spot    nolink # ghost anywhere in a level
  26. thing        cam1look    nolink # ghost anywhere in a level
  27.  
  28. surface        pad
  29. sector        topsector
  30.  
  31. flex        jewelStatus
  32. flex        viewangle            local
  33.  
  34. int            positioned = 0        local
  35.  
  36. end
  37.  
  38. # ========================================================================================
  39. code
  40.  
  41. startup:
  42. Sleep(0.01);
  43. StartCutscene(1);
  44. EndCutscene();
  45. SetCollideType(blastDoor, 0);
  46. SetThingLight(blastDoor, '0.2 0.2 0.2', 0.01, 1.0);
  47. player = GetLocalPlayerThing();
  48.  
  49. return;
  50.  
  51. # ........................................................................................
  52. damaged:
  53. if ((GetSenderRef() == charger) && (GetParam(1) == 0x4000))
  54. {
  55.         
  56.     StartCutscene(1);
  57.     SetThingFlags(player, 0x200000);
  58.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  59.     SetCameraLookInterp(2, 0);             # force snap if not sure already the case
  60.     SetCameraPosInterp(2, 0);             # force snap if not sure already the case
  61.     SetCameraFocus(2, cam1spot);         # cam 2 takes over here
  62.     SetCameraSecondaryFocus(2, cam1look); # looking same place
  63.     viewangle = GetCameraFOV();         # it pays to be careful
  64.     SetCurrentCamera(2);
  65.     ResetCameraFOV(0, 0.0);
  66.     SetCameraLookInterp(2, 1);
  67.     SetCameraPosInterp(2, 1);
  68.     SetCameraInterpSpeed(2, 1.2);       
  69.     Sleep(0.01);                         # let engine work briefly
  70.     #SetCameraFocus(2, offsetcam);         # slide out to new spot
  71.     SetCameraSecondaryFocus(2, jewelTarg); # slide over to new target
  72.     SetCameraFOV(60, 1, 1.2);     # start here anyway
  73.  
  74.     Sleep(1.0);
  75.     MoveToFrame(blastDoor, 1 - GetCurFrame(blastDoor), 1.0);
  76.     Sleep(1.5);
  77.  
  78.     SetCameraInterpSpeed(2, 1.0); # quicker going back, please
  79.     Sleep(0.01);                         # let engine work briefly
  80.     SetCameraSecondaryFocus(2, cam1look);
  81.     SetCameraFOV(viewangle, 1, 1.0); # transition back to follow-cam FOV
  82.     Sleep(1.0);
  83.     SetCameraLookInterp(2, 0); # exit in snap mode
  84.     SetCameraPosInterp(2, 0); # exit in snap mode
  85.     
  86.     
  87.     SetCurrentCamera(1);
  88.     ClearThingFlags(player, 0x200000);
  89.     EndCutscene();
  90. }
  91.  
  92. return;
  93. # ........................................................................................
  94. arrived:
  95. if (GetSenderRef() == blastDoor)
  96. {
  97.     call jewelStatus;
  98.     return;
  99. }
  100. # ........................................................................................
  101. entered:
  102. if ((GetSenderRef() == pad) && (GetSourceRef() == player))
  103. {
  104.     positioned = 1;
  105.     call jewelStatus;
  106. }
  107. if (GetSenderRef() == topSector)
  108. {
  109.     positioned = 1;
  110.     call jewelStatus;
  111. }
  112.  
  113. return;
  114. # ........................................................................................
  115. exited:
  116. if ((GetSenderRef() == pad) && (GetSourceRef() == player)) 
  117. {
  118.     positioned = 0;
  119.     call jewelStatus;
  120. }
  121.  
  122. if (GetSenderRef() == topSector)
  123. {
  124.     positioned = 0;
  125.     call jewelStatus;
  126. }
  127. return;
  128. # ........................................................................................
  129. jewelStatus:
  130. if ((GetCurFrame(blastDoor) == 1) && (positioned == 1))
  131. {
  132.     JewelFlyingStatus(1, plasma);
  133. }
  134. else if ((GetCurFrame(blastDoor) == 0) || (positioned == 0))
  135.  
  136. {
  137.     JewelFlyingStatus(0, plasma);
  138. }
  139. return;
  140. # ........................................................................................
  141.  
  142. end
  143.  
  144.